package com.dandan.testcollection.httprequest;

/**
 * Created by dandan on 2018/4/18.
 */


import com.lzy.okgo.callback.Callback;
import com.lzy.okgo.convert.StringConvert;
import com.lzy.okgo.model.Progress;
import com.lzy.okgo.model.Response;
import com.lzy.okgo.request.base.Request;


public abstract class OnCallBackListener implements Callback<String>
{
    private StringConvert convert;

    public OnCallBackListener() {
        convert = new StringConvert();
    }

    @Override
    public void onStart(Request<String, ? extends Request> request) {

    }

    @Override
    public void onCacheSuccess(Response<String> response) {

    }

    @Override
    public void onFinish() {

    }

    @Override
    public void uploadProgress(Progress progress) {

    }

    @Override
    public void downloadProgress(Progress progress) {

    }

    @Override
    public String convertResponse(okhttp3.Response response) throws Throwable {
        String s = convert.convertResponse(response);
        response.close();
        return s;
    }

}

